<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>法律人</title>
	<link rel="stylesheet" type="text/css" href="css/normalize.css">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/my-style.css">
	<!--[if lt IE 9]> 
		<script src="js/html5shiv.min.js"></script> 
	<![endif]-->
</head>
<body style="background:#f5f5f5;">
		<!-- 导航栏 -->
	<header>
		<nav class="navbar navbar-inverse">
			<div class="container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1" aria-expanded="false">
		        <span class="sr-only">Toggle navigation</span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		      </button>
		      <a class="navbar-brand" href="index.html">
		        <img alt="LOGO" src="img/50x30.png">
		      </a>
				</div>
				<div class="collapse navbar-collapse" id="navbar-collapse-1">
					<ul class="nav navbar-nav navbar-left">
					  		<li><a href="index/home">首页</a></li>
				          	<li><a href="lawyer/list">法律人</a></li>
				          	<li><a href="contract/list">法律产品</a></li>
				         	<li class="cur"><a href="knowledge/list">法律知识</a></li>
					</ul>

					<ul class="nav navbar-nav navbar-right">
						<li><a class="add-btn" href="index/join">法律人入驻<span class="caret"></span></a></li>
				<c:if test="${sessionScope.user == null}">
					<li><a href="user/login">登录</a></li>
					<li><a href="user/register">注册</a></li>
				</c:if>
				<c:if test="${sessionScope.user != null}">
					<li>
					<c:if test="${sessionScope.user.type  == 0}">
					<a href="user/person">${sessionScope.user.username}</a>
					</c:if>
					<c:if test="${sessionScope.user.type  == 1}">
					<a href="lawyer/person">${sessionScope.user.username}</a>
					</c:if>
					<c:if test="${sessionScope.user.type  == 2}">
					<a href="lawyer/person">${sessionScope.user.username}</a>
					</c:if>
					</li>
					<li><a href="user/logout">退出</a></li>
				</c:if>
			</ul>
				</div>
			</div>
		</nav>
	</header>
	
	<section>
		<div class="container">
			<div class="row" style="margin-bottom:20px;">
				<div class="col-md-12 col-sm-12 col-xs-12">
				</div>
			</div>
		</div>
	</section>

	<section>
		<div class="container">
			<div class="row">
				<div class="col-md-9 com-sm-9 col-xs-12">
				<c:forEach items="${details}" var="details"> 
					<div class="sidebar-box sidebar-detail-box">
						<h2>${details.title}</h2>
						<span><fmt:formatDate value="${details.publishTime}" pattern="yyyy/MM/dd"/></span>
						<span>${details.readnum}人阅读</span>
						<span>${details.author}</span>
						<hr/>
						<div>
							<p>${details.content}</p>
						</div>
					</div>
					</c:forEach>
				</div>
				<div class="col-md-3 com-sm-3 hidden-xs">
					<div class="col-md-12 text-center hidden-xs clear-padding">
						<img src="img/lawadvertisement.png" alt="" width="260" height="200">
					</div>

					<div class="col-md-12 col-sm-12 col-xs-12 clear-padding center-block">
						<div class="sidebar-box">
							<h5>热门百科</h5>
							<hr/>
							<ul class="rank-list">
								<li><a href="knowledge/list?type=1"><i>1</i>房产转让</a></li>
								<li><a href="knowledge/list?type=2"><i>2</i>人事诉讼</a></li>
								<li><a href="knowledge/list?type=0"><i>3</i>事故赔偿</a></li>
								<li><a href="knowledge/list?type=0"><i>4</i>劳动争议</a></li>
								<li><a href="knowledge/list?type=0"><i>5</i>故意伤害</a></li>
								<li><a href="knowledge/list?type=0"><i>6</i>交通规则</a></li>
								<li><a href="knowledge/list?type=0"><i>7</i>保险理赔</a></li>
								<li><a href="knowledge/list?type=0"><i>8</i>医疗事故索赔</a></li>
								<li><a href="knowledge/list?type=0"><i>9</i>民间借贷</a></li>
								<li><a href="knowledge/list?type=0"><i>10</i>著作权纠纷</a></li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>







	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(function(){

			//一级菜单选择事件
			$('#list-select-ul1 li').each(function(index){
				$listNum = $('#list-select-ul1 li');
				$listNum2 = $('#list-select-ul2 li');
				$listBox = $('#list-select-box2');
				$(this).click(function(){
					_this = $(this);
					$listNum.removeClass('selected');
					_this.addClass('selected');
					if(index == 0){
						$listBox.hide();
						$listNum2.removeClass('selected');
						$listNum2.eq(0).addClass('selected');
					}else{
						//二级菜单显示
						$listBox.show();
						//二级菜单选择事件	
						$('#list-select-ul2 li').each(function(index){
							$listNum2 = $('#list-select-ul2 li');
							$(this).click(function(){
								__this = $(this);
								$listNum2.removeClass('selected');
								__this.addClass('selected');					
							});	
						});	
					}
				});	
			});	

			
			
		})
	</script>
</body>
</html>